<script setup>
// 导入从JS文件分离出来的变量和函数
import {msg, count, isLoading, testResponse, fetchTest} from '@/views/index/HelloWorld.ts'
</script>
<template>
  <h1>{{ msg }}</h1>
  <div class="card">
    <button type="button" @click="count++">count is {{ count }}</button>
    <button type="button" @click="fetchTest" :disabled="isLoading">
      {{ isLoading ? '请求中...' : '测试请求' }}
    </button>
    <p v-if="testResponse">{{ testResponse }}</p>
  </div>
</template>

<style lang="scss" scoped>
@use '@/views/index/HelloWorld.scss';
</style>